g_simple_action_set_state (action, state);
}
+static GtkWidget *page_stack;
+
+static void
+change_transition_state (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data)
+{
+ GtkStackTransitionType transition;
+
+ if (g_variant_get_boolean (state))
+ transition = GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT;
+ else
+ transition = GTK_STACK_TRANSITION_TYPE_NONE;
+
+ gtk_stack_set_transition_type (GTK_STACK (page_stack), transition);
+
+ g_simple_action_set_state (action, state);
+}
+
static gboolean
get_idle (gpointer data)
{
GtkCssProvider *provider;
static GActionEntry win_entries[] = {
{ "dark", NULL, NULL, "false", change_theme_state },
+ { "transition", NULL, NULL, "false", change_transition_state },
{ "search", activate_search, NULL, NULL, NULL },
{ "delete", activate_delete, NULL, NULL, NULL },
{ "busy", get_busy, NULL, NULL, NULL },
g_signal_connect (stack, "notify::visible-child-name", G_CALLBACK (page_changed_cb), NULL);
page_changed_cb (stack, NULL, NULL);
+ page_stack = stack;
+
dialog = (GtkWidget *)gtk_builder_get_object (builder, "preference_dialog");
g_signal_connect (dialog, "response", G_CALLBACK (close_dialog), NULL);
widget = (GtkWidget *)gtk_builder_get_object (builder, "preference_dialog_button");
<attribute name="label" translatable="yes">Dark Theme</attribute>
<attribute name="action">win.dark</attribute>
</item>
+ <item>
+ <attribute name="label" translatable="yes">Slide Pages</attribute>
+ <attribute name="action">win.transition</attribute>
+ </item>
</section>
</menu>
<menu id="dinner_menu">
<object class="GtkStack" id="toplevel_stack">
<property name="visible">1</property>
<property name="transition-duration">1000</property>
- <property name="transition-type">slide-left-right</property>
<child>
<object class="GtkBox" id="page1">
<property name="visible">1</property>